home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / util / dtype / DT_Descriptors.lha / DT-Descriptors / Hook_Source / ArcCheck.c next >
C/C++ Source or Header  |  1997-07-02  |  636b  |  32 lines

  1. /*
  2.  * ArcCheck.c by TetiSoft
  3.  *
  4.  * Hook Check Func for cli.datatype to check for ARC Archive
  5.  * Tests if file starts with 0x1A01 or 0x1A02 or ... or 0x1A09
  6.  */
  7.  
  8. #include <datatypes/datatypes.h>
  9.  
  10. BOOL __asm __interrupt DTHook (register __a0 struct DTHookContext * dthc)
  11. {
  12.     BOOL IsARC = FALSE;
  13.  
  14.     /* Make sure we have a buffer */
  15.     if (dthc->dthc_Buffer && dthc->dthc_BufferLength>=2)
  16.     {
  17.         UWORD magic=*(UWORD *)dthc->dthc_Buffer;
  18.  
  19.         if(magic==0x1A01
  20.          ||magic==0x1A02
  21.          ||magic==0x1A03
  22.          ||magic==0x1A04
  23.          ||magic==0x1A05
  24.          ||magic==0x1A06
  25.          ||magic==0x1A07
  26.          ||magic==0x1A08
  27.          ||magic==0x1A09)
  28.             IsARC=TRUE;
  29.     }
  30.     return(IsARC);
  31. }
  32.